@extends('layout.admin')

@section('content')
<!-- 放置一个html表单 -->
    <script type="text/javascript" charset="utf-8" src="/admins/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/admins/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/admins/ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span>商品添加</span>
    </div>
    <div class="mws-panel-body no-padding">
    	<form class="mws-form" action="/goods/insert" method="post" enctype="multipart/form-data">
        @if (count($errors) > 0)
            <div class="mws-form-message warning">
                @foreach ($errors->all() as $error)
                {{$error}}<br>
                @endforeach
            </div>
        @endif
    		<div class="mws-form-inline">
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品名</label>
    				<div class="mws-form-item">
    					<input class="small" type="text" name="gname">
    				</div>
    			</div>
                <div class="mws-form-row">
                    <label class="mws-form-label">价格</label>
                    <div class="mws-form-item">
                        <input class="small" type="text" name="price">
                    </div>
                </div>

    			<div class="mws-form-row">
    				<label class="mws-form-label">库存</label>
    				<div class="mws-form-item">
    					<input class="small" type="text" name="cnt">
    				</div>
    			</div>

                <div class="mws-form-inline">
                    <div class="mws-form-row">
                        <label class="mws-form-label">分类</label>
                        <div class="mws-form-item">
                            <select class="small" name="cate_id">
                                <option value="0">请选择</option>
                                @foreach($cates as $k=>$v)
                                <option value="{{$v->cid}}">{{$v->cname}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                </div>
                

                <div class="mws-form-row">
                    <label class="mws-form-label">尺码</label>
                    <div class="mws-form-item">
                        <ul class="mws-form-list inline">
                            <li><input type="checkbox" name="size[]" value="xl"> <label>xl</label></li>
                            <li><input type="checkbox" name="size[]" value="xxl"> <label>xxl</label></li>
                            <li><input type="checkbox" name="size[]" value="l"> <label>l</label></li>
                            <li><input type="checkbox" name="size[]" value="m"> <label>m</label></li>
                            <li><input type="checkbox" name="size[]" value="s"> <label>s</label></li>
                        </ul>
                    </div>
                </div>

                <div class="mws-form-row">
                    <label class="mws-form-label">颜色</label>
                    <div class="mws-form-item">
                        <ul class="mws-form-list inline">
                            <li><input type="checkbox" name="color[]" value="红色"> <label>红色</label></li>
                            <li><input type="checkbox" name="color[]" value="黑色"> <label>黑色</label></li>
                            <li><input type="checkbox" name="color[]" value="白色"> <label>白色</label></li>
                            <li><input type="checkbox" name="color[]" value="青色"> <label>青色</label></li>
                            <li><input type="checkbox" name="color[]" value="黄色"> <label>黄色</label></li>
                        </ul>
                    </div>
                </div>

                <div class="mws-form-row">
                    <label class="mws-form-label">商品图片</label>
                    <div class="mws-form-item">
                        <input class="small" type="file" name="path[]" multiple>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品描述</label>
    				<div class="mws-form-item">
    					<script id="editor" name = "detail" type="text/plain" style="width:750px;height:500px;"></script>
    				</div>
    			</div>
    		</div>
    		<div class="mws-button-row">
    			{{csrf_field()}}
    			<input value="添加" class="btn btn-danger" type="submit">
    			<input value="重置" class="btn " type="reset">
    		</div>
    	</form>
    </div>    	
</div>
<script type="text/javascript">var ue = UE.getEditor('editor');</script>

@endsection


